/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author selam
 */
@Entity
@Table(name = "modificaton")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Modificaton.findAll", query = "SELECT m FROM Modificaton m"),
    @NamedQuery(name = "Modificaton.findByMid", query = "SELECT m FROM Modificaton m WHERE m.mid = :mid")})
public class Modificaton implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "MID")
    private Integer mid;
    @JoinColumn(name = "ProductId", referencedColumnName = "ProductId")
    @ManyToOne(optional = false)
    private Product productId;
    @JoinColumn(name = "PPackageId", referencedColumnName = "PPackageId")
    @ManyToOne(optional = false)
    private Personalpackage pPackageId;

    public Modificaton() {
    }

    public Modificaton(Integer mid) {
        this.mid = mid;
    }

    public Integer getMid() {
        return mid;
    }

    public void setMid(Integer mid) {
        this.mid = mid;
    }

    public Product getProductId() {
        return productId;
    }

    public void setProductId(Product productId) {
        this.productId = productId;
    }

    public Personalpackage getPPackageId() {
        return pPackageId;
    }

    public void setPPackageId(Personalpackage pPackageId) {
        this.pPackageId = pPackageId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mid != null ? mid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Modificaton)) {
            return false;
        }
        Modificaton other = (Modificaton) object;
        if ((this.mid == null && other.mid != null) || (this.mid != null && !this.mid.equals(other.mid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Modificaton[ mid=" + mid + " ]";
    }
    
}
